package Controller.ServicoController;

import javax.swing.JOptionPane;

import DAO.ServicoDAO;
import Entidade.Servico;
import Model.ServicoModel.ServicoModel;
import framework.mvc.GenericController;

public class ServicoController extends GenericController<Servico> {
	public ServicoController() {
		super(new ServicoModel(), new ServicoDAO());
	}

	public void cancelar() {
		view.dispose();
	}

	public void salvar() {
		view.atualizarModel();
		Servico servico = model.getEntidade();
		dao.salvar(servico);
		JOptionPane.showMessageDialog(null, "Registro salvo com sucesso!",
				"Registro salvo", JOptionPane.INFORMATION_MESSAGE);
		view.dispose();
	}
}
